<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>register</title>
    <style>
        body {
            background-color: azure;
            position: relative;
        }

        h1 {
            text-align: center;
        }

        form {
            text-align: center;
            position: relative;
        }

        button {
            margin-left: 120px;
            width: 100px;
            height: 30px;
            background-color: rgb(244, 244, 244);
            border: none;
        }

        a {
            margin-right: 520px;
            font-size: 12px;
            color: cornflowerblue;
        }
    </style>
</head>
<body>
<h1>用户注册</h1>
<form method="get" th:align="center" th:action="@{/register}" th:object="${user}">
    <!--遍历课程列表-->

    <label for="username">用户名: </label>
    <input type="text" name="username" id="username"/>
    <span class="validationError" th:if="${#fields.hasErrors('username')}"
          th:errors="*{username}">username</span><br/>
    <br/>
    <label for="password">密&ensp;&ensp;码: </label>
    <input type="password" name="password" id="password"/>
    <span class="validationError" th:if="${#fields.hasErrors('password')}"
          th:errors="*{password}">password</span><br/>

</form>
<br/>
<a th:href="@{/login}" id="login" style="display: block;text-align:right;">已有账号，我要登录</a>
</body>
</html>